package fina2.dcs.upload;

import java.lang.reflect.Method;

import javax.interceptor.AroundInvoke;
import javax.interceptor.InvocationContext;

import org.jboss.seam.log.Log;
import org.jboss.seam.log.Logging;

public class UploadedFileInterceptor {

	private Log log = Logging.getLog(getClass());

	@AroundInvoke
	public Object invoke(InvocationContext ic) throws Exception {
		try {
			long l = System.currentTimeMillis();
			Method m = ic.getMethod();
			ic.proceed();
			log.debug("Method " + m + " executed in " + (System.currentTimeMillis() - l) + " ms");
		} catch (Exception ex) {
			log.error(ex.getMessage(), ex);
		}
		return null;
	}
}
